﻿using System;
using System.Collections.Generic;
using System.Configuration;
//using System.DirectoryServices.AccountManagement;
//using System.Linq;
//using System.Text;
//using AutoMapper;
//using Castle.Facilities.FactorySupport;
//using Castle.MicroKernel.Registration;
//using Castle.Windsor;
//using Castle.Windsor.Configuration.Interpreters;
//using Microsoft.Practices.ServiceLocation;
//using Inmobiliaria.Core.Domain;
////using Inmobiliaria.Core.DomainServiceInterfaces;
//using Inmobiliaria.Security;
//using Inmobiliaria.Services.Core.DTO;
//using Inmobiliaria.Services.Core.Interfaces;
//using Inmobiliaria.UCControllers;
//using CommonServiceLocator.WindsorAdapter;
//using uNhAddIns.Adapters;
//using Inmobiliaria.Core.DomainServiceInterfaces;
//using Inmobiliaria.UCControllers.Resolvers;

namespace Inmobiliaria.Infrastructure.Configuration
{
    //public class GuyWire : IGuyWire
    //{
    //    private readonly IConfigurator[] configurators = new IConfigurator[]
    //                                                         {
    //                                                             new EntitiesConfigurator()
    //                                                             , new UCControllersConfigurator()
    //                                                             , new DaoConfigurator()
    //                                                         };

    //    private IWindsorContainer container;

    //    #region IGuyWire Members

    //    public void Dewire()
    //    {
    //        if (container != null)
    //            container.Dispose();
    //    }


    //    public void Wire()
    //    {
    //        ConfigureMapperClasses();
    //        if (container != null)
    //            Dewire();
    //        container = new WindsorContainer(new XmlInterpreter());
    //        container.AddFacility<FactorySupportFacility>();

    //        container.Register(Component.For<IWindsorContainer>().Instance(container));

    //        ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container));
    //        container.Register(Component.For<IServiceLocator>().Instance(ServiceLocator.Current));

    //        foreach (IConfigurator configurator in configurators)
    //        {
    //            configurator.Configure(container);
    //        }

    //        container.Register(Component.For<IContextProvider>().ImplementedBy<DomainContextProvider>());
    //    }

    //    private void ConfigureMapperClasses()
    //    {
    //        Mapper.CreateMap<Persona, DtoPersona>();
    //        Mapper.CreateMap<DtoPersona, Persona>();
    //        Mapper.AssertConfigurationIsValid();
    //    }

    //    #endregion
    //}
}
